package com.twb.auth.listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import com.twb.auth.service.ITwbProjectService;

/** 
 * @ClassName TwbAuthRunner 
 * @Description 初始化接入项目缓存数据
 * @author DSY
 * @date 2019年10月28日 下午9:02:22 
 */ 
@Component
public class TwbAuthRunner implements CommandLineRunner {

	@Autowired
	private ITwbProjectService twbProjectService;
	
	private final Logger logger = LoggerFactory.getLogger(TwbAuthRunner.class);
	@Override
	public void run(String... args) throws Exception {
		// TODO Auto-generated method stub
		try {
			twbProjectService.initRedisProject();
			logger.debug("初始化接入项目数据成功");
		} catch (Exception e) {
			// TODO Auto-generated catch block
			logger.debug("初始化接入项目数据失败");
		}
	}
}
